import glm

class Camera:
    def __init__(self, position:glm.vec3, center:glm.vec3, up:glm.vec3) -> None:
        self.position = position
        self.center = center
        self.up = up

    def getViewMatrix(self) -> glm.mat4:
        self.view_matrix = glm.lookAt(self.position, self.center, self.up)
        return self.view_matrix

class PerspectiveCamera(Camera):
    def __init__(self, fov: float, aspect: float, near: float, far: float, 
                 position: glm.vec3, center:glm.vec3, up:glm.vec3) -> None:
        super().__init__(position, center, up)
        self.fov = fov
        self.aspect = aspect
        self.near = near
        self.far = far

    def getProjectionMatrix(self) -> glm.mat4:
        self.projection_matrix = glm.perspective(glm.radians(self.fov),
                                       self.aspect, self.near, self.far)
        return self.projection_matrix

class OrthographicCamera(Camera):
    def __init__(self, left: float, right: float, bottom: float, top: float, 
                 near: float, far: float, 
                 position: glm.vec3, center:glm.vec3, up:glm.vec3) -> None:
        super().__init__(position, center, up)
        self.left = left
        self.right = right
        self.bottom = bottom
        self.top = top
        self.near = near
        self.far = far

    def getProjectionMatrix(self) -> glm.mat4:
        self.project_matrix = glm.ortho(self.left, self.right, self.bottom, 
                                        self.top, self.near, self.far)
        return self.project_matrix


